/*
 * Copyright (c) 2007 Compl Yue Still, All Rights Reserved.
 */

package hbi.wire.as3.host
{
	import flash.utils.ByteArray;
	
	public class UTF8Chunks extends BinaryChunks
	{
		
		override public function get tagValue():*
		{
			var bytes:ByteArray = super.tagValue as ByteArray;
			return bytes.readUTFBytes(bytes.length);
		}
		
		override protected function isFinalChunkTag(tag:int):Boolean
		{
			return tag == 'S'.charCodeAt();
		}
		
		override protected function isNonFinalChunkTag(tag:int):Boolean
		{
			return tag == 's'.charCodeAt();
		}
		
		public function UTF8Chunks(isFinalChunk:Boolean)
		{
			super(isFinalChunk);
		}
		
	}
}
